import request from '@/utils/request'

// 查询發票單列表
export function listInvoice(query) {
  return request({
    url: '/biz/invoice/list',
    method: 'get',
    params: query
  })
}

// 查询發票單详细
export function getInvoice(id) {
  return request({
    url: '/biz/invoice/' + id,
    method: 'get'
  })
}

// 新增發票單
export function addInvoice(data) {
  return request({
    url: '/biz/invoice',
    method: 'post',
    data: data
  })
}

// 修改發票單
export function updateInvoice(data) {
  return request({
    url: '/biz/invoice',
    method: 'put',
    data: data
  })
}

// 删除發票單
export function delInvoice(id) {
  return request({
    url: '/biz/invoice/' + id,
    method: 'delete'
  })
}
// 删除發票單
export function sendInvoice(id) {
  return request({
    url: '/biz/invoice/send/' + id,
    method: 'post'
  })
}
export function downloadInvoice(id) {
  return request({
    url: '/biz/invoice/preview/' + id,
    method: 'get'
  })
}


export function payInvoice(data) {
  return request({
    url: '/biz/invoice/pay',
    method: 'post',
    data:data
  })
}
export function cancelInvoice(data) {
  return request({
    url: '/biz/invoice/cancel',
    method: 'post',
    data:data
  })
}

